package br.com.upper.dao;

import java.util.List;

import br.com.upper.entity.InstanceType;

public class InstanceTypeDAO extends AbstractHibernateDAO<InstanceType, Long> {

	public InstanceTypeDAO() {
		super(InstanceType.class);
	}
	
	public List<InstanceType> findOtherInstancesTest() {
		List<InstanceType> result = null;		
		result = getSession().createQuery("select it from InstanceType it " +
						"where it.index >= (select it2.index from InstanceType it2 " +
							"where it2.id = (select tc.instanceType.id from TestConfiguration tc)) and it.id <> (select tc.instanceType.id from TestConfiguration tc) order by it.index asc").list();
		
		return result;
	}
	
}
